package com.jf.thread;

public class Student extends Thread{
    public String name;
    public int age;

    public Student(String name){
        super(name);
    }

    public void show(){
        System.out.println("大家好，我是"+name+",我的年龄："+age);
    }

    @Override
    public void run() {
        for(int i=1;i<101;i++){
            try {
                /*限制线程启动时间，单位毫秒*/
                sleep(500);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("第"+i+"次调用show()");
            System.out.println("我的线程名："+Thread.currentThread().getName());
            show();
            System.out.println("-----");
        }
    }
}
